package com.jy.common.config;

import com.jy.common.interceptor.MyInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * create by fzg
 * 2021/10/12 12:02
 */

@Component
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login/**")
                .excludePathPatterns("/main-page-swiper/getSwiperImage")
                .excludePathPatterns("/search-history/getHotSearchKey")
                .excludePathPatterns("/goods-index-swiper/getGoodsIndexPageSwiperApi")
                .excludePathPatterns("/goods/getGoodsIndexRecommendInfo")
                .excludePathPatterns("/alioss/**")
                .excludePathPatterns("/good-category/getGoodsCategoryList")
                .excludePathPatterns("/good-category/getGoodByCategoryAid")
        ;
    }
}
